<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://flapi.flapi.dev/');

curl_setopt($ch, CURLOPT_HTTPHEADER, 'Content-Type: application/xml');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);

curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);  
curl_setopt($ch, CURLOPT_USERPWD, 'gareth' . ':' . 'password');  

$return_body = curl_exec($ch);
$return_info = curl_getinfo($ch);

echo '<pre>',var_dump(array($return_body,$return_info)),'</pre>';